import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'
class UserInfo extends Component {
  componentDidMount = () => {
    fetch('http://localhost:3033/user/info').then((result) => {
      return result.json()
    }).then((res) => {
      console.log(1212, res)
      console.log(112, this.props)
      if (res.code === 0) {
        this.props.history.push('/register')
      }
    }).catch((err) => {
      console.log(err);
    });
  }
  render() {
    return (
      <div>
        userInfo
      </div>
    )
  }
}
export default withRouter(UserInfo)
